<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <title>爱租网_管理员登录</title>
  <link rel="icon" href="_img_/logo.ico"> 
  {css href="_js_/layui/css/layui.css"}
  {js href="_js_/jquery2.1.4.min.js"}
  {js href="_js_/layer/layer.js"}
  {js href="_js_/layui/layui.js"}
  {js href="_js_/jquery.validate.min.js"}
  {js href="_js_/jquery.form.js"}
  {js href="_js_/messages_zh.js"}
  <style>
    *{margin:0;padding:0;}
    .error{color:red;}
    .part1{margin:20px 20px;}
    .part1 span{color:#676767;font-size:30px;margin-top:30px;}
    .part2{background:url("_img_/login3.jpg");height:460px;}
    .part2 form{background:#ffffff;margin-top:30px;margin-left:30px;}
    .part2 form>div{margin:30px;}
    .part2 form>div>input{height:50px;font-size:16px;}
    .part2 .title{font-size:20px;color:#ff3366;width:100%;text-align:left;margin-bottom:15px;}
    .part2 button{width:100%;height:50px;font-size:16px;background:#ff3366;}
    .part3{margin-top:50px;text-align:center;color:#555555;}
  </style>
</head>
<body>
  <div class="part1">
  </div>
    <a href="{:url('index/index/index')}"><img src="_img_/login1.png"></a>
    <span>.</span>
    <img src="_img_/login21.png">
  </div>
  <div style="height:30px"></div>
  <div class="part2">
    <form class="layui-form layui-col-xs5 layui-col-sm5 layui-col-md3 " action="javascript:;" method="post">
      <div clas="layui-input-item">
        <label class="title layui-form-label">账号登录</label>
      </div>
      <div class="layui-form-item" style="height: 50px">
        <input class="layui-input" type="text" name="user" autoconplete="off" placeholder="用户名/手机号" required>
      </div>
      <div class="layui-form-item"  style="height: 50px">
        <input class="layui-input" type="password" name="pwd" autoconplete="off" placeholder="密码" required>
      </div>
      <div class="layui-form-item">
        <input type="checkbox" name="remb" lay-skin="primary" title="记住密码" value="1" disabled>
        <div style="margin-top:12px;margin-left:110px;" class="layui-inline"><a class="layui-word-aux forget" href="javascript:;">找回密码</a></div>
      </div>
       <div>
        <button class="layui-btn" type="submit" id="submit">登&nbsp;录</button>
       </div>
    </form>
  </div>
  <div class="part3">
    ©2017 Hangzhou ishangzu Technology Co.,Ltd. All rights reserved. 备案号：浙ICP备15007224号-2浙公网安备 33010802006107号
  </div>

<script type="text/javascript">
  $().ready(function(){
    $('form').validate({
      rules:{

      },
      messages:{
        user:{
          required:'请填写用户名/手机号'
        },
        pwd:{
          required:'请填写密码'
        }
      },
      submitHandler:function(form){
        $(form).ajaxSubmit({
          type:'post',
          url:'{:url('admin/login/do_login')}',
          dataType:'text',
          success:function(res){
            res = eval('('+res+')');
            console.log(res);
            if(res.msg == '成功'){
              layer.msg('登录成功！',{icon:1,time:2000,offset: ['230px', '140px']},function(){
                  location.href = '{:url('admin/index/index')}'})
            }else{
              layer.msg('账号或密码错误！',{icon:2,time:2000,offset: ['230px', '140px']});
            }
          }
        })
      }
    });
  })
  
  $('input[name=remb]').click(function(){
    layer.msg('为了账号安全，禁止记住密码！',{icon:2,time:2000,offset: ['230px', '140px']},function(){$('input[name=remb]').attr('checked',false)});
  });
  $('.forget').click(function(){
    layer.msg('请联系相关管理人员找回密码！',{icon:2,time:2000,offset: ['230px', '100px']});
  });

  layui.use('form', function(){
    var form = layui.form;
    form.render();
  });
</script>
</body>
</html>